<?php
/**
* @file AdminCategories.php
* AdminCategories reached all Posts from Categorie Manager.
* Checks the values and saved the parameter to the database.
*
* @author PortaMx - Portal Management Extension
* @author Copyright 2008-2011 by PortaMx - http://portamx.com
* @Version: 1.0 RC4
* @Date: 23.02.2011
*/

if(!defined('PortaMx'))
	die('This file can\'t be run without PortaMx');

/**
* Receive all the Posts from Cetegories Manager, check and save it.
* Finally the Admin categories are prepared and the templare loaded.
*/
function PortaMx_AdminDownloads()
{
	global $smcFunc, $context, $settings, $txt;

	$admMode = isset($_GET['action']) ? $_GET['action'] : '';
	if(($admMode == 'admin' || $admMode == 'portamx') && isset($_GET['area']) && $_GET['area'] == 'pmx_downloads')
	{
		require_once($context['pmx_sourcedir'] .'AdminSubs.php');
		$context['pmx']['subaction'] = isset($_GET['sa']) ? $_GET['sa'] : 'overview';
		$context['pmx']['admmode'] = $admMode;
		$pmx_area = $_GET['area'];

		// From template ?
		if(PortaMx_checkPOST())
		{
			checkSession('post');

			// check the Post array
			redirectexit('action='. $admMode .';area='. $pmx_area .';sa='. $context['pmx']['subaction'] .';'. $context['session_var'] .'='. $context['session_id']);
		}
		else
			checkSession('get');

		// setup pagetitle
		$context['page_title'] = $txt['pmx_downloads'];

		// load language and execute template
		$txt['pmx_notimplemted'] = '<strong>This feature is not yet available.</strong>';
		$txt['pmx_done_back'] = 'Back';
		loadTemplate($context['pmx_templatedir'] .'AdminDownloads');
	}
	else
		fatal_error($txt['pmx_acces_error']);
}
?>